<template>
  <h2 class="sign-title enter-x mb-3 text-center text-2xl font-bold xl:text-center xl:text-3xl">
    {{ getFormTitle }}
  </h2>
</template>
<script lang="ts" setup name="LoginFormTitle">
import { LoginStateEnum, useLoginState } from './useLogin'

const { t } = useI18n()

const { getLoginState } = useLoginState()

const getFormTitle = computed(() => {
  const titleObj = {
    [LoginStateEnum.RESET_PASSWORD]: t('sign.reset', 'title'),
    [LoginStateEnum.LOGIN]: t('sign.in', 'title'),
    [LoginStateEnum.REGISTER]: t('sign.register', 'title'),
    [LoginStateEnum.MOBILE]: t('sign.in.mode', 'mobile'),
    [LoginStateEnum.QR_CODE]: t('sign.in.mode', 'qrCode'),
    [LoginStateEnum.SSO]: t('sign.in.mode', 'sso')
  }
  return titleObj[unref(getLoginState)]
})
</script>
